package com.smw.service.impl;

import com.smw.service.CodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

@Service
public class CodeImp implements CodeService {
    @Autowired
    private RedisTemplate<String,String>redisTemplate;
    @Override
    public void saveCode(String key, String value) {
        redisTemplate.opsForValue().set(key,value);

    }
    @Override
    public String findCodeByKey(String key) {
        String codeValue=redisTemplate.opsForValue().get(key);
        return codeValue;
    }
}
